import Vue from 'vue'
import Vuex from 'vuex'
import getters from './getters'
import app from './modules/app'
import settings from './modules/settings'
import user from './modules/user'

Vue.use(Vuex)

const store = new Vuex.Store({
  modules: {
    app,
    settings,
    user
  },
  getters
})

export default store

// import Vue from 'vue'
// import Vuex from 'vuex'
// import getters from './getters'


// console.log(app,'app');

// const req = require.context('./modules', false, /\.js$/)
// console.log('req.keys  jsssss', req.keys());  // ['./app.js', './settings.js', './user.js']
// console.log('req.keys.map.req  jsssss', req.keys().map(req));  

// console.log(req.keys().map(item=> item.split('./')[1] ).map(item=> item.split('.js')[0]));  
// // ['app', 'settings', 'user']
// const mName = req.keys().map(item=> item.split('./')[1] ).map(item=> item.split('.js')[0])
// const mModule = req.keys().map(req)  // [module,module,moduel]

// const obj = {}
// mName.forEach((key,index)=> {
//   obj[key] = mModule[index].default
// } )

// console.log('obj',obj);



// Vue.use(Vuex)

// const store = new Vuex.Store({
//   modules: obj,
//   getters
// })

// export default store
